package org.carabiner.infopanel;

import java.awt.Frame;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * A Rule implementation that looks for frames with no title.
 * 
 * <p>
 * Copyright: <a href="http://www.gnu.org/licenses/gpl.html">GNU Public License</a>
 * </p>
 * 
 * @author Ben Rady (benrady@gmail.com)
 * 
 */
public class NoTitleRule extends AbstractRule
{
  public java.util.List inspectFrame(Frame frame)
  {
    if (frame.getTitle() == null || frame.getTitle().equals(""))
    {
      List warnings = new ArrayList(1);
      warnings.add(createWarning(frame));
      return warnings;
    }
    return Collections.EMPTY_LIST;
  }

  public String getDescription()
  {
    return "This frame has no title";
  }

  public String getName()
  {
    return "No Title";
  }
}
